package com.pep.mgmt.model.entity;

import java.time.LocalDateTime;

import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import jakarta.persistence.Entity;
import jakarta.persistence.EntityListeners;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint;
import lombok.Data;

@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
//both of them are working
//@Table(uniqueConstraints = {@UniqueConstraint(columnNames = { "vrf_name", "rcst_ip_addr"})})
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = { "vrfName", "rcstIpAddr" })})
public class RcstIpTablesRule {

    @Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Long id;

    @CreatedDate
    private LocalDateTime creationTime;

    private String vrfName;
    private String rcstIpAddr;
    private String iptablesRules;
}
